package com.lyz.innerclass;

/**
 * @ClassName Quter
 * @Description TODO
 * @Author 2214361854
 * @Date 2022/2/19 15:43
 * @Version 1.0
 */
public class Quter {
    public static int staticA = 100;
    public int staticNO = 100;


    /**
     * 静态内部类
     */
    public static class Inner {
        private String name;

        public void show() {
            //可以直接访问静态成员
            System.out.println(staticA);
            //不能直接访问实例成员
            Quter quter = new Quter();
            System.out.println(quter.staticNO);
        }

        public Inner(String name) {
            this.name = name;
        }

        public Inner() {
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    /**
     * 成员内部类
     */
    public class Inner2 {
        private String name;

        public void show() {
            //可以直接访问静态成员
            System.out.println(staticA);
            //可以直接访问实例成员
            System.out.println(staticNO);
        }

        public Inner2(String name) {
            this.name = name;
        }

        public Inner2() {
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }
}
